package com.star.pay.controller;

import com.alipay.api.AlipayApiException;
import com.alipay.api.domain.AlipayTradeAppPayModel;
import com.star.pay.service.AliPayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author: liminghui
 * @date: 2021/4/30 17:42
 * @version: 1.0
 * @description:
 */
@Controller
@RequestMapping("/")
public class AliPayController {
    @Autowired
    AliPayUtils aliPayUtils;

    @GetMapping(value = "/alipay")
    public String hbaseTest() throws AlipayApiException {
        AlipayTradeAppPayModel model=new AlipayTradeAppPayModel();
        String notifyUrl=null;
        String result = aliPayUtils.startAppPay(model,notifyUrl);
        System.out.println(result);
        return result;
    }
}
